{template '../../../header'}
{template '../../../left'}

<div class="card">
    <div class="card-header">
        评论管理
    </div>
    <div class="card-body">
        <div class="row mb-2">
            <div class="col-12">
                <form method="get" class="form-row">
                    <input type="hidden" name="article_id" value="{$article_id}" />
                    <div class="form-group col-2">
                        <label>文章标题</label>
                        <input type="text" name="filter_article" value="{$filter_article}" class="form-control form-control-sm" />
                    </div>
                    <div class="form-group col-2">
                        <label>起始时间</label>
                        <input type="text" name="filter_begin" value="{$filter_begin}" class="form-control form-control-sm datepicker" />
                    </div>
                    <div class="form-group col-2">
                        <label>结束时间</label>
                        <input type="text" name="filter_end" value="{$filter_end}" class="form-control form-control-sm datepicker" />
                    </div>
                    <div class="form-group col-1">
                        <label>搜索</label>
                        <div class="form-control-static">
                            <button class="btn btn-success btn-sm" type="submit" name="do" value="search"><i class="fa fa-search"></i> 搜索</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <table class="table table-sm table-striped table-hover">
            <thead>
            <th>
                ID
            </th>
            <th>
                文章标题
            </th>
            <th>
                评论内容
            </th>
            <th>
                发布用户
            </th>
            <th>
                发布时间
            </th>
            <th>
                操作
            </th>
            </thead>
            <tbody>
                {loop $rows $row}
                <tr>
                    <td>
                        {$row['id']}
                    </td>
                    <td>
                        <a href="/cms/article/page/id/{$row['article_id']}" target="_blank">{$row['article_title']}</a>
                    </td>
                    <td>
                        {:msubstr(stripTag($row['content']), 0, 30)}
                    </td>
                    <td>
                        {$row['nickname']}
                    </td>
                    <td>
                        {$row['add_time']}
                    </td>
                    <td>
                        <button type="button" class="btn btn-danger btn-sm"  onclick="confirm('你确定要删除吗？') && (location.href='/admin/cms/article/reply/remove?id={$row['id']}')"><i class="fa fa-trash-o"></i></button>
                    </td>
                </tr>
                {/loop}
            </tbody>
        </table>
        {template '../../../page'}
    </div>
</div>

{template '../../../footer'}   